<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>HttpRequest constructor</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httprequest.clearhistory.html">HttpRequest::clearHistory</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httprequest.enablecookies.html">HttpRequest::enableCookies</a></div>
 <div class="up"><a href="class.httprequest.html">HttpRequest</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="httprequest.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">HttpRequest::__construct</h1>
  <p class="verinfo">(PECL pecl_http &gt;= 0.10.0)</p><p class="refpurpose"><span class="refname">HttpRequest::__construct</span> &mdash; <span class="dc-title">HttpRequest constructor</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-httprequest.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="methodname"><strong>HttpRequest::__construct</strong></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$url</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$request_method</code><span class="initializer"> = HTTP_METH_GET</span></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter">$options</code></span>
  ]]] )</div>


  <p class="para rdfs-comment">
   Instantiate a new <a href="class.httprequest.html" class="classname">HttpRequest</a> object.
  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-httprequest.construct-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">url</code></em></dt>

     <dd>

      <p class="para">
       the target request url
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">request_method</code></em></dt>

     <dd>

      <p class="para">
       the request method to use
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">options</code></em></dt>

     <dd>

      <p class="para">
       an associative array with request options
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-httprequest.construct-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   Throws <strong class="classname">HttpException</strong>.
  </p>
 </div>



 


 


 


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="httprequest.clearhistory.html">HttpRequest::clearHistory</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="httprequest.enablecookies.html">HttpRequest::enableCookies</a></div>
 <div class="up"><a href="class.httprequest.html">HttpRequest</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
